<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JsUnit main-results.html</title>
    <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
</head>

<body>
<script language="javascript" type="text/javascript">
    var DEFAULT_SUBMIT_WEBSERVER = "localhost:8080";

    function submitUrlFromSpecifiedUrl() {
        var result = "";
        var specifiedUrl = top.getSpecifiedResultUrl();
        if (specifiedUrl.indexOf("http://") != 0)
            result = "http://";
        result += specifiedUrl;
        return result;
    }

    function submitUrlFromTestRunnerLocation() {
        var result = "http://";
        var webserver = top.getWebserver();
        if (webserver == null) // running over file:///
            webserver = DEFAULT_SUBMIT_WEBSERVER;
        result += webserver;
        result += "/jsunit/acceptor";
        return result;
    }

    var submitUrl = "";
    if (top.wasResultUrlSpecified()) {
        submitUrl = submitUrlFromSpecifiedUrl();
    } else {
        submitUrl = submitUrlFromTestRunnerLocation();
    }

    var formString = "<form name=\"resultsForm\" action=\"" + submitUrl + "\" method=\"post\" target=\"_top\">";
    document.write(formString);
</script>
<input type="hidden" name="id">
<input type="hidden" name="userAgent">
<input type="hidden" name="jsUnitVersion">
<input type="hidden" name="time">
<input type="hidden" name="url">
<input type="hidden" name="cacheBuster">
<select size="5" name="testCases" multiple></select>
<script>
    document.write("</form>");
</script>

<script language="javascript" type="text/javascript">
    function populateHeaderFields(id, userAgent, jsUnitVersion, baseURL) {
        document.resultsForm.id.value = id;
        document.resultsForm.userAgent.value = userAgent;
        document.resultsForm.jsUnitVersion.value = jsUnitVersion;
        document.resultsForm.url.value = baseURL;
        document.resultsForm.cacheBuster.value = new Date().getTime();
    }
    function submitResults() {
        var testCasesField = document.resultsForm.testCases;
        for (var i = 0; i < testCasesField.length; i++) {
            testCasesField[i].selected = true;
        }
        document.resultsForm.submit();
    }
</script>
</body>
</html>
